package org.lmind.scale.asyn

class AsynAction[T](code:()=>Unit) {
  
  private var _fn : (Boolean, T) => Unit = null
  
  def on(fn : (Boolean, T) => Unit) = _fn = fn
  
  def complete(success:Boolean, data:T) = {
    _fn(success, data);
  }
  
  def run = code()
}